package com.sheep.springboot.filter;

import javax.servlet.*;
import java.io.IOException;

/**
 * 使用Servlet中的filter, 也可是使用spring中提供的interceptor
 * author: sheep.Old
 * qq: 64341393
 * Created 2018/11/2
 */
public class MyFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("执行了MyFilter的doFilter方法....");
        filterChain.doFilter(servletRequest, servletResponse);
    }

    @Override
    public void destroy() {

    }
}
